From cf6470f18f6a2318f03f4882c0affaa679e40175 Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 17 Jul 2003 23:22:57 +0000 Subject: [PATCH] Add 'arc' style and xcsv support for tracks and routes --- csv_util.c | 19 ++++++++++++++++++- style/arc.style | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 style/arc.style diff --git a/csv_util.c b/csv_util.c index 9d3c7701a..c6014dc73 100644 --- a/csv_util.c +++ b/csv_util.c @@ -795,6 +795,12 @@ xcsv_waypt_pr(const waypoint *wpt) index++; } +static void +xcsv_noop(const route_head *wp) +{ + /* no-op */ +} + /*****************************************************************************/ /* xcsv_data_write(void) - write prologues, spawn the output loop, and write */ /* epilogues. */ @@ -810,7 +816,18 @@ xcsv_data_write(void) ogp = (ogue_t *) elem; fprintf (xcsv_file.xcsvfp, "%s%s", ogp->val, xcsv_file.record_delimiter); } - waypt_disp_all(xcsv_waypt_pr); + + switch (global_opts.objective ) { + case wptdata: + waypt_disp_all(xcsv_waypt_pr); + break; + case rtedata: + case trkdata: + route_disp_all(xcsv_noop,xcsv_noop,xcsv_waypt_pr); + break; + default: + break; + } /* output epilogue lines, if any. */ QUEUE_FOR_EACH(&xcsv_file.epilogue, elem, tmp) { diff --git a/style/arc.style b/style/arc.style new file mode 100644 index 000000000..82fcbc9bc --- /dev/null +++ b/style/arc.style @@ -0,0 +1,21 @@ +# gpsbabel XCSV style file +# +# Format: GPSBabel arc filter format +# Author: Ron Parker +# Date: 17 July 2003 +# + +DESCRIPTION GPSBabel arc filter file +EXTENSION txt + +# +# FILE LAYOUT DEFINITIIONS: +# +FIELD_DELIMITER TAB +RECORD_DELIMITER NEWLINE + +# +# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: +# +IFIELD LAT_DECIMAL, "", "%08.5f" +IFIELD LON_DECIMAL, "", "%08.5f" -- 2.30.2